﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace td.Core.DiscoverAddins
{
    public partial class RunTimeInfo : DevExpress.XtraEditors.XtraUserControl
    {
        
        public RunTimeInfo(td.Core.Xml.AddIn a)
        {
            InitializeComponent();
            this.addin = a;
            init();
            
        }
        td.Core.Xml.AddIn addin { get; set; }
        void init()
        {
            var c = addin;
            this.tbVersion.Text = c.Version;
            this.tbUrl.Text = c.URL;
            this.tbName.Text = c.Name;
            this.tbCopyright.Text = c.CopyRight;
            this.dtDate.EditValue = c.ModifyDate == null ? (object)DateTime.Now : c.ModifyDate;
        }
        
        //保存
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            addin.Version = this.tbVersion.Text;
            addin.URL = this.tbUrl.Text;
            addin.Name = this.tbName.Text;
            addin.CopyRight = this.tbCopyright.Text;
            addin.ModifyDate = this.dtDate.EditValue.ToString();
        }

    }
}
